﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DriveBeamEditor.Controls.BeamNG;
using DriveBeamEditor.Controls.General;
using DriveBeamEditor.Enums;
using DriveBeamEditor.Forms;
using JBeamLibrary;
using JBeamLibrary.Types;
using JBeamLibrary.VehicleParts;
using JBeamLibrary.VehicleParts.Enums;
using JColor = JBeamLibrary.VehicleParts.Elements.Color;

namespace DriveBeamEditor
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            /* Read the configuration */
            Config.Read();

            /* Splash screen */
            using (var splash = new SplashForm { IdleTime = 1000 })
            {
                splash.ShowDialog();
            }

            /* Run application */
            using (var form = new MainDockingForm() { Name = "MainForm" })
            {
                Application.Run(form);
            }

            /* Save the config */
            Config.Save();
        }
    }
}
